
export class UploadAdapter {
    loader
    pageModelService
    constructor(loader, pageModelService) {
        this.loader = loader
        this.pageModelService = pageModelService
        this.upload()
    }
    upload() {
        return new Promise(async (resolve, reject) => {
            let file = await this.loader.file.then(res => res);
            const formData: FormData = new FormData();
            formData.append('cover', file);
            this.pageModelService.upload(formData).subscribe(res => {
                resolve({
                    default: res.url
                })
            })
        });
    }
}
